﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmProducto.aspx.cs" Inherits="PharmacyWeb.Almacen.frmProducto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"><asp:Panel ID="Panel2" runat="server"><b>.: Liz Vigo:.</b> <br/> <h5>Ingrese Aquí su criterio de Búsqueda</h5></asp:Panel>
    <asp:TextBox runat="server" Text="Creador" ID="txtAutor"></asp:TextBox>
    <ajaxToolkit:BalloonPopupExtender runat="server" BalloonPopupControlID="Panel2" BalloonStyle="Cloud" ExtenderControlID="" CustomCssUrl="" DynamicServicePath="" Enabled="True" TargetControlID="txtAutor" ID="txtAutor_BalloonPopupExtender"></ajaxToolkit:BalloonPopupExtender>
    <asp:FormView runat="server" ID="fvProducto"
        DefaultMode="Insert" ItemType="PharmacyBussinesEntities.Producto"
        SelectMethod="GetProducto"
        UpdateMethod="UpdateProducto"
        InsertMethod="InsertProducto">
        <InsertItemTemplate>
            <div class="panel panel-info">
    	<div class="panel-heading">
    	    <div class="col-lg-12">
                <h3><label class="control-label" id="Titulo">Registrar Producto</label></h3>
            </div>
    	</div>
    	<div class="panel-body">
    	    <div class="col-lg-12">
                <div class="col-lg-6">
        	        <table class="table">
        	            <tr>
                            <td><label class="control-label">Codigo:</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                 Width="70px" ReadOnly="True" ID="txtId" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Nombre:</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                 ID="txtNombre" runat="server" Text="<%# BindItem.Nombre %>"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Descripcion</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm" 
                               Text="<%# BindItem.Descripcion %>" ID="txtDescripcion" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Principio Activo</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                Text="<%# BindItem.PrincipioActivo %>" ID="txtPrincipioActivo" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Categoria</label></td>
                            <td>                      
                                <asp:DropDownList ID="cbCategorias" runat="server"
                                CssClass="form-control input-sm"
                                ItemType="PharmacyBussinesEntities.Categoria"
                                SelectMethod="GetCategorias"
                                DataTextField="Nombre"
                                DataValueField="Id" 
                                SelectedValue='<%# BindItem.IdCategoria %>' />
                            
                            </td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Presentacion</label></td>
                            <td>                        
                                <asp:DropDownList ID="cbPresentacion" runat="server"
                                CssClass="form-control input-sm"
                                ItemType="PharmacyBussinesEntities.Presentacion"
                                SelectMethod="GetPresentacion"
                                DataTextField="Descripcion"
                                DataValueField="Id" 
                                SelectedValue='<%# BindItem.IdPresentacion %>' />
                        
                            </td>
                        </tr>                
                    </table>
                </div>
                <div class="col-lg-6">
        	            <table class="table">
        	                <tr>
        	    	            <td><label class="control-label">Laboratorios</label></td>
                                <td>
                                    <asp:DropDownList ID="cbLaboratorio" runat="server"
                                    CssClass="form-control input-sm"
                                    ItemType="PharmacyBussinesEntities.Laboratorio"
                                    SelectMethod="GetLaboratorios"
                                    DataTextField="Descripcion"
                                    DataValueField="Id" 
                                    SelectedValue='<%# BindItem.IdLaboratorio %>' />
                                </td>        	                    
        	                </tr>
                            <tr>
        	    	            <td><label class="control-label">Stock</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm"
                                    Text="<%# BindItem.Stock %>" ID="txtStock" runat="server"/></td>
        	                </tr>
                            <tr>
        	    	            <td><label class="control-label">Stock Minimo</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm" 
                                    Text="<%# BindItem.StockMinimo %>" ID="txtStockMin" runat="server" /></td>
        	                </tr>
                             <tr>
        	    	            <td><label class="control-label">Stock Maximo</label></td>
                                 <td><asp:TextBox CssClass="form-control input-sm" 
                                     Text="<%# BindItem.StockMaximo %>" ID="txtStockMax" runat="server"/></td>
        	                </tr>
                            <tr>
                                <td><label class="control-label">Unidad Medida</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm" ID="txtUndMedida"  Width="50px" runat="server"/>
                                    <asp:DropDownList ID="cbUnidadMedida" runat="server"
                                        CssClass="form-control input-sm"
                                        ItemType="PharmacyBussinesEntities.UnidadMedida"
                                        SelectMethod="GetUnidadMedidas"
                                        DataTextField="Nombre"
                                        DataValueField="Id" 
                                        SelectedValue='<%# BindItem.IdUnidadMedida %>' />
                                 </td>
                            </tr>
                    
        	            </table>
                    </div>        
                </div>
    	</div>
        <div class="panel-footer">
            <asp:Button runat="server" ID="btnGuardar"
                Text="Guardar" CommandName="insert"
                CssClass="btn btn-success"/>
            <a href="frmListProductos.aspx" class="btn btn-danger">Cancelar</a>
        </div>    	
    </div>
        </InsertItemTemplate>
        <EditItemTemplate>
            <div class="panel panel-info">
    	        <div class="panel-heading">
    	            <div class="col-lg-12">
                        <h3><label class="control-label" id="Titulo">Registrar Editar</label></h3>
                    </div>
    	        </div>
    	        <div class="panel-body">
    	            <div class="col-lg-12">
                <div class="col-lg-6">
        	        <table class="table">
        	            <tr>
                            <td><label class="control-label">Codigo:</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                 Width="70px" ReadOnly="True" 
                               Text="<%# BindItem.Id %>" ID="txtId" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Nombre:</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                 ID="txtNombre" runat="server" Text="<%# BindItem.Nombre %>"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Descripcion</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm" 
                               Text="<%# BindItem.Descripcion %>" ID="txtDescripcion" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Principio Activo</label></td>
                            <td><asp:TextBox CssClass="form-control input-sm"
                                Text="<%# BindItem.PrincipioActivo %>" ID="txtPrincipioActivo" runat="server"/></td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Categoria</label></td>
                            <td>                      
                                <asp:DropDownList ID="cbCategorias" runat="server"
                                CssClass="form-control input-sm"
                                ItemType="PharmacyBussinesEntities.Categoria"
                                SelectMethod="GetCategorias"
                                DataTextField="Nombre"
                                DataValueField="Id" 
                                SelectedValue='<%# BindItem.IdCategoria %>' />
                            
                            </td>
                        </tr>
                        <tr>
                            <td><label class="control-label">Presentacion</label></td>
                            <td>                        
                                <asp:DropDownList ID="cbPresentacion" runat="server"
                                CssClass="form-control input-sm"
                                ItemType="PharmacyBussinesEntities.Presentacion"
                                SelectMethod="GetPresentacion"
                                DataTextField="Descripcion"
                                DataValueField="Id" 
                                SelectedValue='<%# BindItem.IdPresentacion %>' />
                        
                            </td>
                        </tr>                
                    </table>
                </div>
                <div class="col-lg-6">
        	            <table class="table">
        	                <tr>
        	    	            <td><label class="control-label">Laboratorios</label></td>
                                <td>
                                    <asp:DropDownList ID="cbLaboratorio" runat="server"
                                    CssClass="form-control input-sm"
                                    ItemType="PharmacyBussinesEntities.Laboratorio"
                                    SelectMethod="GetLaboratorios"
                                    DataTextField="Descripcion"
                                    DataValueField="Id" 
                                    SelectedValue='<%# BindItem.IdLaboratorio %>' />
                                </td>        	                    
        	                </tr>
                            <tr>
        	    	            <td><label class="control-label">Stock</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm"
                                    Text="<%# BindItem.Stock %>" ID="txtStock" runat="server"/></td>
        	                </tr>
                            <tr>
        	    	            <td><label class="control-label">Stock Minimo</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm" 
                                    Text="<%# BindItem.StockMinimo %>" ID="txtStockMin" runat="server" /></td>
        	                </tr>
                             <tr>
        	    	            <td><label class="control-label">Stock Maximo</label></td>
                                 <td><asp:TextBox CssClass="form-control input-sm" 
                                     Text="<%# BindItem.StockMaximo %>" ID="txtStockMax" runat="server"/></td>
        	                </tr>
                            <tr>
                                <td><label class="control-label">Unidad Medida</label></td>
                                <td><asp:TextBox CssClass="form-control input-sm" ID="txtUndMedida"  Width="50px" runat="server"/>
                                    <asp:DropDownList ID="cbUnidadMedida" runat="server"
                                        CssClass="form-control input-sm"
                                        ItemType="PharmacyBussinesEntities.UnidadMedida"
                                        SelectMethod="GetUnidadMedidas"
                                        DataTextField="Nombre"
                                        DataValueField="Id" 
                                        SelectedValue='<%# BindItem.IdUnidadMedida %>' />
                                 </td>
                            </tr>             
        	            </table>
                    </div>        
                </div>
    	        </div>
    	        <div class="panel-footer">
                    <asp:Button runat="server" ID="btnGuardar"
                        Text="Guardar" CommandName="insert"
                        CssClass="btn btn-success"/>
                    <a href="frmListProductos.aspx" class="btn btn-danger">Cancelar</a>
                </div>
            </div>
        </EditItemTemplate>
    </asp:FormView>
    
</asp:Content>
